package com.qut.system_1.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

@Mapper
public interface medicineMapper {
    @Insert("insert into medicine(medicineId,inPrice,salPrice,mcount,medicineName," +
            "medicineType,descs,qualityDate,description,produceFirm," +
            "readme,remark) values(#{medicineId},#{inPrice},#{salPrice},#{mcount},#{medicineName}," +
            "#{medicineType},#{descs},#{qualityDate},#{description},#{produceFirm}," +
            "#{readme},#{remark})")
    int save(Map<String,String> param);

    List<Map<String,Object>> search(Map<String,String> param);

    int delete(String[] ids);

    @Update("update medicine set medicineId=#{medicineId},inPrice=#{inPrice},salPrice=#{salPrice}," +
            "mcount=#{mcount},medicineName=#{medicineName},medicineType=#{medicineType}," +
            "descs=#{descs},qualityDate=#{qualityDate},description=#{description}," +
            "produceFirm=#{produceFirm},readme=#{readme},remark=#{remark} where medicineId=#{medicineId}")
    int update(Map<String,String> param);

}
